﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RedisComm
{
    public class ConfigInfo
    {
        private static string _RedisConnStr;
        private static string _RedisKeyStr;

        /// <summary>
        /// Redis连接字符串
        /// </summary>
        public static string RedisConnStr
        {
            get
            {
                if (string.IsNullOrEmpty(_RedisConnStr))
                {
                    _RedisConnStr = ConfigurationManager.ConnectionStrings["RedisExchangeHosts"].ConnectionString;
                }
                return _RedisConnStr;
            }
        }
        /// <summary>
        /// Redis-Key的前缀
        /// </summary>
        public static string RedisKeyStr { get {
                if (string.IsNullOrEmpty(_RedisKeyStr))
                {
                    _RedisKeyStr = ConfigurationManager.AppSettings["redisKey"] ?? "";
                }
                return _RedisKeyStr;
            } }
    }
}
